package com.homework.exam02.Config;


import com.homework.exam02.Config.CustomCommandLineRunner;
import com.homework.exam02.Config.CustomProperties;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
@EnableConfigurationProperties(CustomProperties.class)
public  class Exam02AutoConfig {

    @Bean
    @ConditionalOnProperty(prefix = "exam02.auto", name = "enable", havingValue = "true")
    CommandLineRunner creatCustomCommandLineRunner(Environment evn){
        return new CustomCommandLineRunner(evn);
    }

}
